<!DOCTYPE html>
<html>


<!-- Mirrored from www.zi-han.net/theme/hplus/table_data_tables.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:01 GMT -->

<head>

    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">


    <title>对账接入者管理系统</title>
    <meta name="keywords" content="对账接入者管理系统">
    <meta name="description" content="对账接入者管理系统">

    <link rel="shortcut icon" href="{{asset('dealer/img/favicon.ico')}}">
    <link href="{{asset('dealer/css/bootstrap.min.css')}}" rel="stylesheet">
    <link href="{{asset('dealer/css/font-awesome.min.css')}}" rel="stylesheet">

    <!-- Data Tables -->
    <link href="{{asset('dealer/css/plugins/dataTables/dataTables.bootstrap.css')}}" rel="stylesheet">

    <link href="{{asset('dealer/css/animate.min.css')}}" rel="stylesheet">
    <link href="{{asset('dealer/css/style.min.css')}}" rel="stylesheet">

    <link href="{{asset('dealer/css/plugins/datapicker/datepicker3.css')}}" rel="stylesheet">

    <link rel="stylesheet" type="text/css" href="{{asset('layui/src/css/layui.css')}}" />
</head>

<body class="gray-bg">
<style>
    table.dataTable thead .sorting:after {
        content: "";
    }

    table.dataTable,
    .table-bordered {
        text-align: center;
    }
</style>
<div class="wrapper wrapper-content animated fadeInRight">
    <div class="row" style="margin-bottom: 15px">
        <div class="col-sm-3">
            <div class="input-group">
                <input type="text"   id="like" placeholder="姓名或联系方式" class="input-sm form-control" style="margin-left:0 ">
                <span class="input-group-btn">
                        <button type="button" class="btn btn-sm btn-primary" id="searchkey"> 搜索</button>
                    </span>
            </div>
        </div>
        <div class="col-sm-3 m-b-xs">
            <select class="input-sm form-control input-s-sm inline" id="rankselect" style="margin-left:0;width:58%;float:right">
                <option value="">请选择等级</option>
                <option value="0">普通用户</option>
                <option value="1">经销商</option>
                <option value="2">合伙人</option>
                <option value="3">服务中心</option>

            </select>
            <span style="float:right;height: 30px;line-height: 30px;">等级：</span>
        </div>
        <div class="col-sm-5 m-b-xs">
            {{--<div class="form-group" id="data_5">--}}
                {{--<div class="input-daterange input-group" id="datepicker" style="margin-left: 10%;">--}}
                    {{--<span class="input-group-addon">时间段：</span>--}}
                    {{--<input type="text" class="input-sm form-control" name="start" value="2017-11-11" style="margin-left: 0" />--}}
                    {{--<span class="input-group-addon">到</span>--}}
                    {{--<input type="text" class="input-sm form-control" name="end" value="2017-11-17" style="margin-left: 0" />--}}
                    {{--<button type="button" class="btn btn-sm btn-primary" style="position: absolute"> 搜索</button>--}}
                {{--</div>--}}
            {{--</div>--}}
        </div>
    </div>
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>交易记录管理</h5>
                </div>
                <div class="ibox-content">
                    <div class="row" style="margin-bottom: 5px">
                    </div>
                    <table class="table table-striped table-bordered table-hover dataTables-example">
                        <thead>
                        <tr>
                            <th style="text-align: center;">
                                <strong>序号</strong>
                            </th>
                            <th style="text-align: center;">
                                <strong>姓名</strong>
                            </th>
                            <th style="text-align: center;">
                                <strong>联系方式</strong>
                            </th>
                            <th style="text-align: center;">
                                <strong>等级</strong>
                            </th>
                            <th style="text-align: center;">
                                <strong>总收益（元）</strong>
                            </th>
                            <th style="text-align: center;">
                                <strong>操作</strong>
                            </th>
                        </tr>
                        </thead>
                        <tbody id="tbody-content">


                        </tbody>
                    </table>
                    <div class="row">
                        <div id="pages" style="float: right;"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>


<script src="{{asset('dealer/js/jquery.min.js')}}"></script>
<script src="{{asset('dealer/js/bootstrap.min.js')}}"></script>
<script src="{{asset('dealer/js/plugins/jeditable/jquery.jeditable.js')}}"></script>

<script src="{{asset('dealer/js/content.min.js')}}"></script>
<script type="text/javascript" src="{{asset('lib/laypage/1.2/laypage.js')}}"></script>
<script type="text/javascript" src="{{asset('layui/src/layui.js')}}"></script>
<script src="{{asset('dealer/js/plugins/cropper/cropper.min.js')}}"></script>
<script src="{{asset('dealer/js/plugins/datapicker/bootstrap-datepicker.js')}}"></script>
<script>


    function fnClickAddRow() {
        $("#editable").dataTable().fnAddData(["Custom row", "New row", "New row", "New row", "New row"])
    };

    //日期选择js代码--7.30修改
    $(document).ready(function () {
        function e() {
            var e = $("body")[0].style;
            $("#demo_apidemo").colorpicker({
                color: e.backgroundColor
            }).on("changeColor", function (o) {
                e.backgroundColor = o.color.toHex()
            }), $("#demo_forceformat").colorpicker({
                format: "rgba",
                horizontal: !0
            }), $(".demo-auto").colorpicker(), $(".disable-button").click(function (e) {
                e.preventDefault(), $("#demo_endis").colorpicker("disable")
            }), $(".enable-button").click(function (e) {
                e.preventDefault(), $("#demo_endis").colorpicker("enable")
            })
        }
        var o = $(".image-crop > img");
        $(o).cropper({
            aspectRatio: 1.618,
            preview: ".img-preview",
            done: function () {}
        });

        var r = $("#inputImage");
        window.FileReader ? r.change(function () {
            var e, i = new FileReader,
                t = this.files;
            t.length && (e = t[0], /^image\/\w+$/.test(e.type) ? (i.readAsDataURL(e), i.onload =
                function () {
                    r.val(""), o.cropper("reset", !0).cropper("replace", this.result)
                }) : showMessage("请选择图片文件"))
        }) : r.addClass("hide"), $("#download").click(function () {
            window.open(o.cropper("getDataURL"))
        }), $("#zoomIn").click(function () {
            o.cropper("zoom", .1)
        }), $("#zoomOut").click(function () {
            o.cropper("zoom", -.1)
        }), $("#rotateLeft").click(function () {
            o.cropper("rotate", 45)
        }), $("#rotateRight").click(function () {
            o.cropper("rotate", -45)
        }), $("#setDrag").click(function () {
            o.cropper("setDragMode", "crop")
        }), $("#data_1 .input-group.date").datepicker({
            todayBtn: "linked",
            keyboardNavigation: !1,
            forceParse: !1,
            calendarWeeks: !0,
            autoclose: !0
        }), $("#data_2 .input-group.date").datepicker({
            startView: 1,
            todayBtn: "linked",
            keyboardNavigation: !1,
            forceParse: !1,
            autoclose: !0,
            format: "yyyy-mm-dd"
        }), $("#data_3 .input-group.date").datepicker({
            startView: 2,
            todayBtn: "linked",
            keyboardNavigation: !1,
            forceParse: !1,
            autoclose: !0
        }), $("#data_4 .input-group.date").datepicker({
            minViewMode: 1,
            keyboardNavigation: !1,
            forceParse: !1,
            autoclose: !0,
            todayHighlight: !0
        }), $("#data_5 .input-daterange").datepicker({
            keyboardNavigation: !1,
            forceParse: !1,
            autoclose: !0
        })
    });


    $(document).ready(function () {
        var sum = "";
        var id=$('#hid').val();
        var like=$('#like').val();
        var rank=$(this).children('option:selected').val();//用户选择的值
        $.ajax({
            method: "POST",
            url: "C_deal",
            data: { "type":"1","rows": 10, "page": 1,'_token':'{{csrf_token()}}',"like": like,"rank": rank},
            async: false,
            dataType: "json",
            success:function (eval) {
                if ( eval.code == '200' ) {
                    sum = eval.data.total;
                    console.log('sum='+eval.data.total);
                } else if ( eval.code == '666' ) {
                    loginFaild();
                }
            }
        });


        layui.use('laypage', function(){
            var laypage = layui.laypage;

            //总页数大于页码总数
            laypage.render({
                elem: 'pages'
                ,count: sum //数据总数
                ,jump: function(obj){
                    console.log(obj.curr)
                    $.ajax({
                        method: "POST",
                        url: "C_deal",
                        data: {"type":"1","rows": 10, "page": obj.curr,'_token':'{{csrf_token()}}'  },
                        dataType: "json",
                        success:function (eval) {
                            if ( eval.code == '200' ) {
                                $('#tbody-content').html("");
                                $.each(eval.data.records, function (index, item) {
                                    if(item.rank==0){
                                        item.rank='普通用户';
                                    }else if(item.rank==1){
                                        item.rank='经销商 ';
                                    }else if(item.rank==2){
                                        item.rank='合伙人 ';
                                    }else if(item.rank==3){
                                        item.rank='服务中心 ';
                                    }




                                    var html = '<tr >\n' +
                                        '                <td >' + parseInt(index+1) + '</td>\n' +
                                        '                <td >' + item.name + '</td>\n' +
                                        '                <td >' + item.phone + '</td>\n' +
                                        '                <td >' + item.rank + '</td>\n' +
                                        '                <td class="center">\n' +
                                        '                    <i class="fa fa-cny">' + item.totalAmount + '</i>\n' +
                                        '                </td>\n'+
                                        '                <td class="center">\n' +
                                        '                    <a href="{{action('DealController@c_deal_details')}}?id='+item.id+'&type=2" class="btn btn-w-m btn-info">查看详情</a>\n' +
                                        '                </td>\n'+
                                    '                 </tr>' ;
                                    $('#tbody-content').append(html);
                                });
                            }
                        }
                    });
                }
            });
        });



        //关键字搜索
        $('#searchkey').on('click', function () {



            var sum = "";

            var like=$('#like').val();
            var rank=$(this).children('option:selected').val();//用户选择的值
            $.ajax({
                method: "POST",
                url: "C_deal",
                data: { "type":"1","rows": 10, "page": 1,'_token':'{{csrf_token()}}',"like": like,"rank": rank},
                async: false,
                dataType: "json",
                success:function (eval) {
                    if ( eval.code == '200' ) {
                        sum = eval.data.total;
                        console.log('sum='+eval.data.total);
                    } else if ( eval.code == '666' ) {
                        loginFaild();
                    }
                }
            });


            layui.use('laypage', function(){
                var laypage = layui.laypage;

                //总页数大于页码总数
                laypage.render({
                    elem: 'pages'
                    ,count: sum //数据总数
                    ,jump: function(obj){
                        console.log(obj.curr)
                        $.ajax({
                            method: "POST",
                            url: "C_deal",
                            data: {"rows": 10, "page": obj.curr,'_token':'{{csrf_token()}}',"like":encodeURI(like) },
                            dataType: "json",
                            success:function (eval) {
                                if ( eval.code == '200' ) {
                                    $('#tbody-content').html("");
                                    $.each(eval.data.records, function (index, item) {
                                        if(item.rank==0){
                                            item.rank='普通用户';
                                        }else if(item.rank==1){
                                            item.rank='经销商 ';
                                        }else if(item.rank==2){
                                            item.rank='合伙人 ';
                                        }else if(item.rank==3){
                                            item.rank='服务中心 ';
                                        }




                                        var html = '<tr >\n' +
                                            '                <td >' + parseInt(index+1) + '</td>\n' +
                                            '                <td >' + item.name + '</td>\n' +
                                            '                <td >' + item.phone + '</td>\n' +
                                            '                <td >' + item.rank + '</td>\n' +
                                            '                <td class="center">\n' +
                                            '                    <i class="fa fa-cny">' + item.totalAmount + '</i>\n' +
                                            '                </td>\n'+
                                            '                <td class="center">\n' +
                                            '                    <a href="{{action('DealController@c_deal_details')}}?id='+item.id+'&type=2" class="btn btn-w-m btn-info">查看详情</a>\n' +
                                            '                </td>\n'+
                                            '                 </tr>' ;
                                        $('#tbody-content').append(html);
                                    });
                                }
                            }
                        });
                    }
                });
            });




        })

//等级搜索
        $('#rankselect').change(function () {
            // alert($(this).children('option:selected').val());




            var sum = "";

            var like=$('#like').val();
            var rank=$(this).children('option:selected').val();//用户选择的值
            $.ajax({
                method: "POST",
                url: "C_deal",
                data: { "type":"1","rows": 10, "page": 1,'_token':'{{csrf_token()}}',"like": like,"rank": rank},
                async: false,
                dataType: "json",
                success:function (eval) {
                    if ( eval.code == '200' ) {
                        sum = eval.data.total;
                        console.log('sum='+eval.data.total);
                    } else if ( eval.code == '666' ) {
                        loginFaild();
                    }
                }
            });


            layui.use('laypage', function(){
                var laypage = layui.laypage;

                //总页数大于页码总数
                laypage.render({
                    elem: 'pages'
                    ,count: sum //数据总数
                    ,jump: function(obj){
                        console.log(obj.curr)
                        $.ajax({
                            method: "POST",
                            url: "C_deal",
                            data: {"rows": 10, "page": obj.curr,'_token':'{{csrf_token()}}',"rank":rank },
                            dataType: "json",
                            success:function (eval) {
                                if ( eval.code == '200' ) {
                                    $('#tbody-content').html("");
                                    $.each(eval.data.records, function (index, item) {
                                        if(item.rank==0){
                                            item.rank='普通用户';
                                        }else if(item.rank==1){
                                            item.rank='经销商 ';
                                        }else if(item.rank==2){
                                            item.rank='合伙人 ';
                                        }else if(item.rank==3){
                                            item.rank='服务中心 ';
                                        }




                                        var html = '<tr >\n' +
                                            '                <td >' + parseInt(index+1) + '</td>\n' +
                                            '                <td >' + item.name + '</td>\n' +
                                            '                <td >' + item.phone + '</td>\n' +
                                            '                <td >' + item.rank + '</td>\n' +
                                            '                <td class="center">\n' +
                                            '                    <i class="fa fa-cny">' + item.totalAmount + '</i>\n' +
                                            '                </td>\n'+
                                            '                <td class="center">\n' +
                                            '                    <a href="{{action('DealController@c_deal_details')}}?id='+item.id+'&type=2" class="btn btn-w-m btn-info">查看详情</a>\n' +
                                            '                </td>\n'+
                                            '                 </tr>' ;
                                        $('#tbody-content').append(html);
                                    });
                                }
                            }
                        });
                    }
                });
            });


        })
//






    })


    function loginFaild() {

        alert('登录失效')
        var t = setInterval(function () {
            window.location.href="login";
            clearInterval(t);
        }, 2000);
    }



</script>


</body>


<!-- Mirrored from www.zi-han.net/theme/hplus/table_data_tables.html by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:20:02 GMT -->

</html>